package gui;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import swing2swt.layout.BorderLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Table;


public class DoeMaarWat extends Composite
{
	private Table tableHuidigeLeningen;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public DoeMaarWat(Composite parent, int style)
	{
		super(parent, style);
		setLayout(new FillLayout(SWT.VERTICAL));
		
		Group grpHuidigeLeningen = new Group(this, SWT.NONE);
		grpHuidigeLeningen.setText("Huidige Leningen");
		grpHuidigeLeningen.setLayout(new FillLayout(SWT.HORIZONTAL));
		
		tableHuidigeLeningen = new Table(grpHuidigeLeningen, SWT.BORDER | SWT.FULL_SELECTION);
		tableHuidigeLeningen.setHeaderVisible(true);
		tableHuidigeLeningen.setLinesVisible(true);

		String[] columnHeaders = {"Titel", "Auteur", "Geleend", "Inleverdatum"};
		String[][] data = {
				{"Magier", "Raymond E. Feist", "2013-04-13", "2013-04-30"},
				{"Jimmie de Hand", "Raymond E. Feist", "2013-048-13", "2013-05-07"}
		};
		
		for(String[] d : data)
		{
			for(int i = 0; i < d.length; i++)
			{
				tableHuidigeLeningen.setData(columnHeaders[i], d[i]);
			}
		}
		
		Group grpVorigeLeningen = new Group(this, SWT.NONE);
		grpVorigeLeningen.setText("Vorige Leningen");
	}

	@Override
	protected void checkSubclass()
	{
		// Disable the check that prevents subclassing of SWT components
	}
}
